fix: sync hidden providers state with header totalRuns count#66
fix: sync hidden providers state with header totalRuns count#66NianJiuZst wants to merge 3 commits intopinchbench:mainfrom
Conversation
|
@NianJiuZst is attempting to deploy a commit to the Kilo Code Team on Vercel. A member of the Team first needs to authorize it. |
Move hiddenProviders state out of ScatterGraphs into LeaderboardView via controlled props. This enables parent-level synchronization of legend toggle state with header totalRuns.
…d state Split filtering into two layers: - businessFilteredEntries: provider filter + open weights (legend stays complete) - scatterVisibleEntries: business filters + hiddenProviders (chart + header sync) headerEntries selects scatterVisibleEntries only when in scatter graph view, so totalRuns stays in sync with chart dots without affecting other sub-views. Also prune hiddenProviders when business filters change to avoid stale entries.
7dc61fb to
a921f9b
Compare
ScuttleBot
left a comment
There was a problem hiding this comment.
ScuttleBot review 🦀
Good state management fix. The bug was subtle: hiding a provider in the scatter chart legend didn't update the header's run count.
The problem:
hiddenProviderswas local state insideScatterGraphsLeaderboardViewcomputedtotalRunsfromfilteredEntries— which had no visibility into what the chart was hiding- Counts went stale
The fix:
- Lift
hiddenProvidersstate toLeaderboardView - Split filtering:
businessFilteredEntries(provider filter + open weights) stays for totalRuns/legend/tables ScatterGraphsreceiveshiddenProvidersas controlled props for chart-only rendering
Key insight I like: Hidden providers still appear in the legend (so users can toggle them back), and totalRuns correctly reflects the business filter, not the visual toggle. That's the right UX — "hide" means "hide from chart" not "remove from existence."
Clean separation of concerns. LGTM.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@olearycrew Hi! Could you please authorize the Vercel deployment for this PR when you get a chance? The changes are ready for review. Thanks so much! 😊 |
Bug
When a user hides a provider by clicking on the scatter graph's provider legend, the header's
totalRunscount does not update to reflect the hidden entries.Root Cause
hiddenProviderswas managed as internal local state (useState) insideScatterGraphs. When users toggled legend items:ScatterGraphsupdated its ownhiddenProvidersstateLeaderboardView'stotalRunswas computed fromfilteredEntries, which had no knowledge ofhiddenProvidersArchitecture (Before)
Fix
Split filtering into two layers:
Commit 1:
fix(scatter-graphs): extract hiddenProviders to controlled propsLift
hiddenProvidersstate out ofScatterGraphsintoLeaderboardViewvia controlled props.Commit 2:
fix(leaderboard-view): split business filters from legend-hidden providersbusinessFilteredEntries: provider filter + open weights only. Used for totalRuns, legend provider list, and all charts/tables.ScatterGraphsadditionally applieshiddenProvidersinternally for chart rendering only.Architecture (After)
Key insight:
hiddenProvidersonly controls chart rendering inScatterGraphs— it does NOT affect the legend's provider list or the header'stotalRuns. Users can toggle providers back on/off from legend individually.Files Changed
components/leaderboard-view.tsx—hiddenProvidersstate +businessFilteredEntriesmemocomponents/scatter-graphs.tsx— acceptshiddenProviders+onHiddenProvidersChangeas propsTesting
totalRunscount in the headertotalRunscount does not change (the hidden entries are still counted in total runs)